package nc.bs.common.util;

import nc.bs.common.util.pojo.TempAccountDetail;
import nc.bs.io.util.FileUtil;
import nc.bs.lang.util.NCDefLangUtil;

import java.util.List;

/**
 * @author duanyp1
 * @date 2024/3/14 15:50
 */
public class GlBalanceUtil {


    private static final String fileName = "gl_balance";
    private static final String accountBookHolder = "${pk_accountingbook}";
    private static final String yearMonthHolder = "${pk_yearmonth}";


    public static List<TempAccountDetail> queryGlBalanceData(String accountBook, String year, String month) {
        String sql = FileUtil.readFileAsStringBySQL(NCDefLangUtil.class, fileName);
        sql = sql.replace(accountBookHolder, accountBook);
        sql = sql.replace(yearMonthHolder, year + "-" + month);
        return DaoUtil.executeQueryList(sql, TempAccountDetail.class);
    }


}
